<style>

</style>

<div class="portlet">
    <form class="portlet-search-body" name="queryForm">
    	<input type="text" class="form-control search-item" ng-model="orderId" placeholder="制作单编号">
    	<input type="text" class="form-control search-item" ng-model="workbillId" placeholder="工单编号">
        <select class="form-control search-item" ng-model="status"
                ng-options="opt.value as opt.name for opt in options.workbill_status">
            <option value="" disabled selected hidden>-- 状态 --</option>
        </select>
        <div class="search-item">
            <button class="btn btn-icon-only default"><i class="fa fa-chevron-right"></i></button>
            <button class="btn btn-sm query" ng-click="grid.query();"><i class="fa fa-search"></i> 查询</button>
            <button class="btn btn-sm reset" ng-click="grid.reset();"><i class="fa fa-eraser"></i> 重置</button>
        </div>
    </form>
    <div class="portlet-body">
        <table ed-grid="grid" class="table table-striped table-bordered table-advance table-hover"
               data-options="url: 'workbill/query.do?orderType={{orderType}}&workbillType={{workbillType}}', modelText: 'xx列表', form: 'queryForm', modal: 'modal'">
            <thead>
	            <tr>
	                <th data-options="field: '_index'"></th>
	                <th data-options="field: 'workbillId'" style="width: 10%;text-align: ;">工单编号</th>
	                <th data-options="field: 'orderId'" style="width: 10%;text-align: ;">制作单编号</th>
	                <th data-options="field: 'customerId'" style="width: 10%;text-align: ;">所属客户</th>
	                <th data-options="field: 'makeTime | limitTo : 10'" style="width: 10%;text-align: ;">日期</th>
	                <th data-options="" style="width: 40%;text-align: ;">制作车辆</th>
	                <th data-options="field: 'status | code : workbill_status'" style="width: 10%;text-align: ;">状态</th>
	                <th style="text-align: ;">操作</th>
	            </tr>
            </thead>
        </table>
    </div>
</div>


<div ed-modal="workbillModal" data-options="title: '工作单明细', static: true, width: 1000, defaultButton:false,onHidden:'reset'">
	<form style="display: none;"><div class="form-actions"></div></form>
	<div class="portlet" style="margin-bottom: 0px;">
		<div class="portlet-body">
			<div style="height: 450px;overflow:auto;">
				<div style="text-align: center;padding: 5px auto;font-size: 25px;">
					胶贴制作工作单
				</div>
			    <div>
			       	<span>制表日期：{{workbill.makeTime | limitTo : 10}}</span>
			       	<div style="display: inline-block;float: right;">
			       		<span style="">工作单编号：{{workbill.workbillId}}</span>
			       	</div>
			    </div>
			    <div id="orderViewItemTab">
			    	<div class="dataTables_wrapper dt-bootstrap no-footer __web-inspector-hide-shortcut__" >
						<table class="table table-striped table-bordered table-advance table-hover dataTable no-footer" style="width:100%;">
							<thead>
								<tr role="row">
									<th class="sorting_disabled" style="width: 5%;"></th>
									<!-- <th class="sorting_disabled" style="width: 10%;">所属公司</th>
									<th class="sorting_disabled" style="width: 8%;">线路</th> -->
									<th class="sorting_disabled" style="width: 8%;">车牌号</th>
									<th class="sorting_disabled" style="width: 8%;">自编号</th>
									<th class="sorting_disabled" style="width: 8%;">车型</th>
									<th class="sorting_disabled" style="width: 9%;">发布形式</th>
									<th class="sorting_disabled" style="width: 8%;">广告内容</th>
									<th class="sorting_disabled" style="width: 15%;">胶贴小样</th>
									<th class="sorting_disabled" style="width: 10%;">胶贴形式</th>
									<th class="sorting_disabled" style="width: 10%;">交货时间</th>
								</tr>
							</thead>
							<tbody>
								<tr role="row"  ng-repeat="item in workbill.workbillItems"><!--class:even -->
									<td style="text-align: center;">{{$index + 1}}</td>
									<!-- <td>{{item.orderItem.busCompany}}</td>
									<td>{{item.orderItem.busLineName}}</td> -->
									<td>{{item.orderItem.busPlateNo}}</td>
									<td>{{item.orderItem.busVehicleNo}}</td>
									<td>{{item.orderItem.busType}}</td>
									<td>{{item.orderItem.publishType | code:'bus_ad_type'}}</td>
									<td>{{item.orderItem.adName}}</td>
									<td>{{item.orderItem.sampleName}}</td>
									<td>{{item.orderItem.stickerType | code : 'sticker_type'}}</td>
									<td>{{item.orderItem.limitDate | limitTo : '10'}}</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div>备注：{{workbill.description}}</div>
					<hr style="">
					<!-- <div>
				       	<div style="width: 30%;display: inline-block;">下发人：{{workbill.sender}}</div>
				    </div> -->
			    </div>
			</div>
		</div>
	</div>
</div>

<div ed-modal="workbillSendModal" data-options="title: '工作单下发', static: true, width: 1000, defaultButton:false,onHidden:'reset'">
	<form style="display: none;"><div class="form-actions"></div></form>
	<div class="portlet" style="margin-bottom: 0px;">
		<div class="portlet-body">
			<div style="height: 400px;overflow:auto;">
			    <div>
			    	<div class="dataTables_wrapper dt-bootstrap no-footer __web-inspector-hide-shortcut__" >
						<table class="table table-striped table-bordered table-advance table-hover dataTable no-footer" style="width:100%;">
							<thead>
								<tr>
									<th class="sorting_disabled" style="width: 10%;">任务名称</th>
									<th class="sorting_disabled" style="width: 20%;">责任人</th>
									<th class="sorting_disabled" style="width: 15%;">完成时限</th>
									<th class="sorting_disabled" style="width: 50%;">备注</th>
								</tr>
							</thead>
							<tbody>
								<tr role="row"  ng-repeat="step in steps"><!--class:even -->									
									<td>{{step.name}}</td>
									<td>
										<div ed-combotree placeholder="责任人"
										 data-options="idField: 'id', textField: 'name', parentIdField: 'parentId'"
										 ng-model="step.empId" ed-selectable="data.id.indexOf('DEPT') == -1" ed-data="empList">
										</div>
									</td>
									<td>
										<input type="text" placeholder="完工时限" class="form-control"  ed-date-picker name="limitTime" ng-model="step.limitTime" style="width: 100%;">
									</td>
									<td style="text-align: center;">
										<textarea class="form-control"  placeholder="备注" style="width: 100%;" rows="1" ng-model="step.remark"></textarea>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
			    </div>
			</div>
			<div class="form-actions">
	            <button type="button" class="btn blue" ng-click="grid.sendWorkBill();">
	                <i class="fa fa-times"></i> 提交
	            </button>
	        </div>
		</div>
	</div>
</div>

<div ed-modal="workbillTasksModal" data-options="title: '工作单明细', static: true, width: 1000, defaultButton:false,onHidden:'reset'">
	<div class="portlet" style="margin-bottom: 0px;">
		<div class="portlet-body">
			<div style="height: 450px;overflow:auto;">
				<div style="text-align: center;padding: 5px auto;font-size: 25px;">
					胶贴制作工作单
				</div>
			    <div>
			       	<span>制表日期：{{workbill.makeTime | limitTo : 10}}</span>
			       	<div style="display: inline-block;float: right;">
			       		<span style="color: orange;">■未完成</span><span style="color: red;padding:0 20px;">■已完成</span>
			       		<span style="">工作单编号：{{workbill.workbillId}}</span>
			       	</div>
			    </div>
			    <div>
			    	<div class="dataTables_wrapper dt-bootstrap no-footer __web-inspector-hide-shortcut__" >
						<table class="table table-striped table-bordered table-advance table-hover dataTable no-footer" style="width:100%;">
							<thead>
								<tr role="row">
									<th class="sorting_disabled" style="width: 3%;"></th>
									<!-- <th class="sorting_disabled" style="width: 8%;">所属公司</th>
									<th class="sorting_disabled" style="width: 6%;">线路</th> -->
									<th class="sorting_disabled" style="width: 8%;">车牌号</th>
									<th class="sorting_disabled" style="width: 8%;">自编号</th>
									<th class="sorting_disabled" style="width: 6%;">车型</th>
									<th class="sorting_disabled" style="width: 9%;">发布形式</th>
									<th class="sorting_disabled" style="width: 8%;">广告内容</th>
									<th class="sorting_disabled" style="width: 10%;">胶贴小样</th>
									<th class="sorting_disabled" style="width: 8%;">胶贴形式</th>
									<th class="sorting_disabled" style="width: 8%;">交货时间</th>
									<th class="sorting_disabled" style="width: 7%;"
									   ng-repeat="step in steps">{{step.name}}</th>
								</tr>
							</thead>
							<tbody>
								<tr role="row"  ng-repeat="item in workbill.workbillItems"><!--class:even -->
									<td style="text-align: center;">{{$index + 1}}</td>
									<!-- <td>{{item.orderItem.busCompany}}</td>
									<td>{{item.orderItem.busLineName}}</td> -->
									<td>{{item.orderItem.busPlateNo}}</td>
									<td>{{item.orderItem.busVehicleNo}}</td>
									<td>{{item.orderItem.busType}}</td>
									<td>{{item.orderItem.publishType | code:'bus_ad_type'}}</td>
									<td>{{item.orderItem.adName}}</td>
									<td>{{item.orderItem.sampleName}}</td>
									<td>{{item.orderItem.stickerType | code : 'sticker_type'}}</td>
									<td>{{item.orderItem.limitDate | limitTo : '10'}}</td>
									<td class="sorting_disabled" style="width: 10%;"
									   ng-repeat="step in steps">
									   <span ng-if="step.id == task.taskType && task.workbillItemId == item.workbillItemId" ng-repeat = 'task in workbill.tasks'
									      ng-style="{color:task.status == '1' ? 'orange':'red'}">
									   		{{task.empName}}
									   </span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
			    </div>
			</div>
		</div>
	</div>
</div>


